package cz.muni.fi.pa165.sme.api;

import java.util.List;

import cz.muni.fi.pa165.sme.api.to.SportActivityTO;
import cz.muni.fi.pa165.sme.api.to.UserTO;

/**
 * The interface for operation with {@link SportActivityTO}
 *
 * @author Martin Nov?k
 */
public interface SportActivityService {

	/**
	 * Adds a new {@link SportActivityTO} to a storage, creates its ID. Object's ID must be null.
	 *
	 * @param sportActivity {@link SportActivityTO} to be created.
	 */
	void createSportActivity(final SportActivityTO sportActivity);

	/**
	 * Removes a {@link SportActivityTO} object from a storage. Object's ID must not be null.
	 *
	 * @param sportActivity {@link SportActivityTO} to be removed.
	 */
	void deleteSportActivity(final SportActivityTO sportActivity);

	/**
	 * Updates a {@link SportActivityTO} object as requested. Object's ID must not be null; parameters can be
	 * changed to null where applicable.
	 *
	 * @param sportActivity {@link SportActivityTO} to be updated
	 */
	void updateSportActivity(final SportActivityTO sportActivity);

	/**
	 * Finds a {@link SportActivityTO} object by its ID.
	 *
	 * @param id ID to be looked up in the storage
	 * @return {@link SportActivityTO} with the provided ID, or null if none found
	 */
	SportActivityTO findSportActivityById(final Long id);

	/**
	 * Finds all {@link SportActivityTO}s related to the provided {@link UserTO}.
	 *
	 * @param title object to get the data for; must not be null
	 * @return list of all related {@link SportActivityTO}s; never null.
	 */
	List<SportActivityTO> findSportActivityByTitle(final String title);

	/**
	 * Returns all {@link SportActivityTO}s from the storage.
	 *
	 * @return list of all {@link SportActivityTO}s; never null.
	 */
	List<SportActivityTO> findAllSportActivities();


	/**
	 * Check existnece in the database. Provided input cannot be null.
	 *
	 * @param sportActivityTO to be checked for existence
	 * @return true if in database, false if either not there or if id is null
	 */
	boolean exists(final SportActivityTO sportActivityTO);


	/**
	 * Checks provided object for references. Provided input cannot be null.
	 * @param sportActivityTO to be checked
	 * @return true if referenced, false if no references found or if id is null or input is not in the storage
	 */
	boolean isReferenced(final SportActivityTO sportActivityTO);
}